<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="b">
    <div id="all" style="padding-top: 20px">
        <div id="content">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <!-- breadcrumb-->
                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <i class="fa fa-eye" style="padding-top: 2px"></i>当前位置:&nbsp;&nbsp;
                                <li class="breadcrumb-item"><a href="/">主页</a></li>
                                <li class="breadcrumb-item"><a href="/customer/personalCenter">个人中心</a></li>
                                <li class="breadcrumb-item"><span th:text="${title}"></span></li>
                            </ol>
                        </nav>
                    </div>
                    <div class="col-lg-3">
                        <div th:include="page/customer/menuLeft::#m"></div>
                    </div>
                    <div id="basket" class="col-lg-9" th:if="${reservationList.size()<1}">
                        <div class="box container">
                            <h3>您还没有预约单，<a href="/reservation/doctorCanReserve">点我去添加</a></h3>
                        </div>
                    </div>
                    <div id="basket" class="col-lg-9" th:if="${reservationList.size()>=1}">
                        <div class="box container">
                            <p class="text-muted">您一共有 <span
                                    th:text="${reservationList.size()}" style="color: red"></span> 条预约记录</p>
                            <div>
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th style="text-align: center">预约类型</th>
                                        <th style="text-align: center">预约的宠物名</th>
                                        <th style="text-align: center">预约时间</th>
                                        <th style="text-align: center">预约的医生</th>
                                        <th style="text-align: center">预约状态</th>
                                        <th style="text-align: center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="reservation:${reservationList}">
                                        <td style="text-align: center">
                                            <span th:text="${reservation.type}"></span>
                                        </td>
                                        <td style="text-align: center">
                                            <span th:text="${reservation.pet.name}"></span>
                                        </td>
                                        <td style="text-align: center">
                                            <span th:text="${#dates.format(reservation.reserveDate,'yyyy-MM-dd HH:mm')}"></span>
                                        </td>
                                        <td style="text-align: center">
                                            <span th:text="${reservation.user.trueName}"></span>
                                        </td>
                                        <td style="text-align: center">
                                            <span th:if="${reservation.status==0}">未处理(⊙﹏⊙)</span>
                                            <span th:if="${reservation.status==1}"
                                                  style="color: #0c9076">预约成功(๑•̀ㅂ•́)و✧</span>
                                            <span th:if="${reservation.status==2}" style="color: red">预约失败〒▽〒</span>
                                            <span th:if="${reservation.status==3}" style="color: darksalmon">预约结束┏(＾0＾)┛</span>
                                        </td>
                                        <td style="text-align: center">
                                            <a th:href="@{'/reservation/reservationDetails?reservationId='+${reservation.id}}"><i
                                                    class="fa fa-search" style="font-size: 20px;color: #0099FF"></i></a>
                                            <a th:href="@{'/reservation/reservationModify?reservationId='+${reservation.id}}"
                                               th:if="${reservation.status==0}"><i class="fa fa-pencil"
                                                                                   style="font-size: 20px"></i></a>
                                            <a th:href="@{'javascript:deleteReservation('+${reservation.id}+')'}" th:if="${reservation.status==0}"><i class="fa fa-trash-o"
                                                                                            style="color: red;font-size: 20px"></i></a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive-->
                            <div class="box-footer d-flex justify-content-between flex-column flex-lg-row">
                                <div>
                                    <a href="/reservation/doctorCanReserve" type="button"
                                       class="btn btn-primary">去预约</a>
                                </div>
                            </div>
                        </div>
                        <div class="pages" th:if="${total>5}">
                            <nav aria-label="Page navigation example" class="d-flex justify-content-center">
                                <ul class="pagination">
                                    <div th:utext="${pageCode}" class="form-inline"></div>
                                </ul>
                            </nav>
                        </div>
                        <!-- /.box-->
                    </div>
                    <!-- /.col-lg-9-->
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>